import { createStoreBindings } from 'mobx-miniprogram-bindings'
import { store } from '@/utils/store'
import { call } from '@/utils/request'
import { showMsg, showLoading, hideLoading, showSuccess, showBookError } from '@/utils/toast'

Page({
  data: {
    is_img_loaded: false
  },
  onLoad() {
    showLoading()
    this.storeBindings = createStoreBindings(this, {
      store,
      fields: ['address'],
    })
  },
  onUnload() {
    // 解绑
    this.storeBindings.destroyStoreBindings()
  },
  onImageLoad() {
    setTimeout(() => {
      this.setData({
        is_img_loaded: true
      })
      hideLoading()
    }, 100)
  },
  showBigImage() {
    const pic = 'cloud://prod-7gk926fb556e9aad.7072-prod-7gk926fb556e9aad-1355355452/images/venue_map.jpg'
    wx.previewImage({
      current: pic,
      urls: [pic]
    });
  },
  handleCopy() {
    wx.setClipboardData({
      data: this.data.address
    });
  }
})